package main.BehaviorModel.interpreterModel.springInterpreterTest;

import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpression;
import org.springframework.expression.spel.standard.SpelExpressionParser;

public class Test01 {

    public static void main(String[] args) {
        SpelExpressionParser parser  = new SpelExpressionParser();
        Expression expression = parser.parseExpression("(100-3+70) * 3");
        String expressionString = expression.getExpressionString();
        Integer value = expression.getValue(Integer.class);
        System.out.println(String.format("%s 计算结果为 %d",expressionString,value));
    }
}
